<?php defined('SYSPATH') or die('No direct script access.');

class Helper_Checker {
 
	static public function imgName($name){
		if(strlen($name)<3){
			return true;// have error
		}
		return false; 
	}
	
	
	static public function fileEmpty($file){
		
		if(is_array($file)){
			return false;
		}
		return true; // have error
	}
	
	static public function fileImage($file){
		$allow = array('image/png','image/jpg','image/jpeg');
		if($type = strtolower($file['type'])){
			if(in_array($type, $allow)){
				return false;			
			}			
		}
		return true; // have error
	}
	
	static public function fileSize($file){
		
		if(isset($file['size'])){
			if($file['size']>20000){
				return false;			
			}			
		}
		return true; // have error
	}



}